/**
 * 
 */
package com.axt.dbaudit.bean.cfg;

import java.util.List;

import com.axt.dbaudit.base.MsgFuncExt;
import com.axt.dbaudit.model.cfg.EmailCfg;
import com.axt.dbaudit.model.query.Alarm;
import com.axt.soa.bean.BaseFuncBean;
import com.axt.soa.msg.types.MsgParam;

public class EmailCfgBean extends BaseFuncBean{
	/**
	 * queryEmailCfg
	 */
	public List<EmailCfg> queryEmailCfg(String serverPath)
	{
		prepare(serverPath);
		
		return fetch(
				MsgFuncExt.FUNC_QUERY_EMAIL_CFG, 
				"com.axt.dbaudit.model.EmailCfg",
				"EmailCfg", CONN_T_TCP);
	}
	/**
	 * updateEmailCfg
	 */
	public int updateEmailCfg(String serverPath, EmailCfg emailCfg)
	{
		prepare(serverPath);
		
		request.addParam(MsgParam.MSG_COL_AU_HOST, emailCfg.getAu_host());
		request.addParam(MsgParam.MSG_COL_AU_PORT, emailCfg.getAu_port());
		request.addParam(MsgParam.MSG_COL_AU_USERNAME, emailCfg.getAu_UserName());
		request.addParam(MsgParam.MSG_COL_AU_PWD, emailCfg.getAu_Passwd());
		request.addParam(MsgParam.MSG_COL_AU_FADDRESS, emailCfg.getAu_Faddress());
		request.addParam(MsgParam.MSG_COL_AU_TADDRESS, emailCfg.getAu_Taddress());
		return execute(MsgFuncExt.FUNC_UPDATE_EMAIL_CFG,CONN_T_TCP);
	}

}
